package com.ytc.service;

import com.ytc.model.Author;
import org.apache.ibatis.annotations.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "service-provider")
public interface AuthorService {

    /*示例，可以删掉*/
    @RequestMapping("queryList")
    List<Author> queryList();

    /*柴晓颖：新增作者*/
    @RequestMapping("addAuthor")
    void addAuthor(@RequestBody Author author);

    //柴晓颖：根据userid查作者id
    @RequestMapping("queryAuthoridByUserid")
    Long queryAuthoridByUserid(@RequestParam("uId") Integer uId);


    //张泽萌：通过uid查询作者
    @RequestMapping("queryAuthorByUid")
    Author queryAuthorByUid(@RequestParam("uId")Integer uId);

    //柴晓颖：查询收藏数
    @RequestMapping("queryShelfNum")
    Long queryShelfNum(@RequestParam("blId") Integer blId);
}
